#include<stdlib.h>
#include<stdio.h>
#include<time.h>

int main(char *args[]){
	
	int i,m=5,n=50,randnum;
	srand( time(NULL) );
	int outloop=n;
	int limit=m;
	
	for(i = 0; i < n; i++ )
	{
		if(rand() % outloop < limit)
		{
			printf("rand %d\n",i);
			limit--;
		}
		outloop--;
	}
}